package cn.cool.types.enums;

import cn.cool.types.exception.AppException;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum GroupBuyOrderEnumVO {
    PROGRESS(0, "拼单中"),
    COMPLETE(1, "完成"),
    FAIL(2, "失败"),;


    private final Integer code;
    private final String info;

    public static GroupBuyOrderEnumVO valueOf(Integer code) {
        for (GroupBuyOrderEnumVO value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        throw new AppException("枚举类型不存在：" + code);
    }
}
